//
//  CYDrawCashHeaderView.m
//  CaiYun
//
//  Created by 今日信息科技 on 2017/7/11.
//  Copyright © 2017年 今日信息科技. All rights reserved.
//

#import "CYDrawCashHeaderView.h"

@implementation CYDrawCashHeaderView
+(NSArray *)getHeader{
    CYView *backView = [[CYView alloc]initWithColor:[UIColor whiteColor]];
    backView.bounds = CGRectMake(0.0, 0.0, SCREEN_WIDTH, AL(PT(62 + 12 * 2)));

    WS(backView)
    
   CYLabel *title = [[CYLabel alloc]initWithText:@"申请提款前请先完善以下资料以绑定银行卡" size:AL(PT(24)) textcolor:ColorHex(0xff9a65)];
    [backView addSubview:title];
    
    [title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(weakSelf);
        make.size.mas_equalTo(title.bounds.size);
    }];
    
    CYImageView *sign = [[CYImageView alloc]initWithImageName:@"gantanhao" size:CGSizeMake(AL(PT(25)), AL(PT(25))) isRadius:NO];
    [backView addSubview:sign];
    
    [sign mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf);
        make.right.equalTo(title.mas_left).with.offset( - AL(PT(6)));
        make.size.mas_equalTo(sign.bounds.size);
    }];
    
    for (int i = 0; i < 2; i ++) {
       CYView *line = [CYDrawCashHeaderView line];
        [backView addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(weakSelf);
            make.size.mas_equalTo(line.bounds.size);
            if (i == 0)
                make.top.equalTo(weakSelf).with.offset(0);
            else
                make.bottom.equalTo(weakSelf.mas_bottom).with.offset(0);
        }];
    }
    
    CYView *sectionLine = [CYDrawCashHeaderView line];
    return @[@{@"headerView":backView,@"headerHeight":@(backView.bounds.size.height)},@{@"headerView":sectionLine,@"headerHeight":@(sectionLine.bounds.size.height)}];
}

+(CYView *)line{
    CYView *line = [[CYView alloc]initWithColor:ColorHex(0xf5f5f9)];
    line.bounds = CGRectMake(0.0, 0.0, SCREEN_WIDTH, AL(PT(12)));
    return line;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
